<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:client="http://www.kohana.vn/client">
<ui:composition template="Client-template.xhtml">
	<ui:param name="title" value="Chi tiết giỏ hàng" />
	<ui:define name="body">
		<h:form>
			<h:panelGrid columns="4" cellspacing="10">
				<c:forEach var="anItem" items="#{cartBean.items}">
					<h:graphicImage value="#{anItem.product.image}" width="75" height="75"/>
					<h:outputText value="#{anItem.product.name}" />
					<h:outputText value="#{anItem.product.price}" rendered="#{not anItem.product.sale}" styleClass="price"/>
					<h:outputText value="#{anItem.product.salePrice}" rendered="#{anItem.product.sale}" styleClass="price"/>
					<h:panelGroup>
						<h:outputText value="Số lượng"/>
						<h:inputText value="#{anItem.quantity}" style="width:20px"/>
					</h:panelGroup>
				</c:forEach>
			</h:panelGrid>
			<br></br>
			<h:panelGrid columns="2">
				<h:commandButton value="Đặt hàng" action="#{cartBean.order}" styleClass="button"/>
				<h:commandButton value="Xóa giỏ hàng" action="#{cartBean.clear}" styleClass="button"/>
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>
</html>